<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增入职登记')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body>
<div class="main-content">
    <form id="form-entrymanage-add" class="form-horizontal" AUTOCOMPLETE="OFF">
        <input name="deptId" type="hidden" id="treeId"/>
        <h4 class="form-header h4">基本信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">工号：</label>
                    <div class="col-sm-8">
                        <input name="badge" id="badge" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>姓名：</label>
                    <div class="col-sm-8">
                        <input name="name" id="name" class="form-control" type="text" required/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>公司名称：</label>
                    <div class="col-sm-8">
                        <select id="compId" name="compId" class="form-control" th:onchange="getbumen(this.value)"
                                required>
                            <option value="">请选择</option>
                            <option th:each="company:${companys}" th:value="${company.compID}"
                                    th:text="${company.title}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>部门名称：</label>
                    <div class="col-sm-8">
                        <select name="depId" id="depId" class="form-control m-b" th:onchange="getgangwei(this.value)">
                            <option value="">请选择</option>
                            <option th:each="odepartment:${departments}" th:value="${odepartment.DepID}"
                                    th:text="${odepartment.title}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>工作岗位：</label>
                    <div class="col-sm-8">
                        <select name="jobId" id="jobId" class="form-control m-b" onchange="getJobGrade()">
                            <option value="">请选择</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">岗位级别：</label>
                    <div class="col-sm-8">
                        <input name="JobGrade" id="JobGrade" type="text" readonly="readonly" class="form-control">
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">直接上级：</label>
                    <div class="col-sm-8">
                        <input name="ReportToName" id="ReportToName" type="text" onclick="getReportTo()"
                               class="form-control">
                        <input name="ReportTo" id="ReportTo" type="hidden" class="form-control">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">职能上级：</label>
                    <div class="col-sm-8">
                        <input name="WFReportToName" id="WFReportToName" type="text" onclick="getWFReportTo()"
                               class="form-control">
                        <input name="WFReportTo" id="WFReportTo" type="hidden" class="form-control">
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>员工类别：</label>
                    <div class="col-sm-8">
                        <select name="EmpType" id="EmpType" class="form-control m-b"
                                th:with="type=${@dict.getType('ECD_EMPTYPE')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">核心高管：</label>
                    <div class="col-sm-8">
                        <select name="hxgg" id="hxgg" class="form-control m-b"
                                th:with="type=${@dict.getType('sys_user_sex')}">
                            <option value="0">否</option>
                            <option value="1">是</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>工作城市：</label>
                    <div class="col-sm-8">
                        <input name="WorkCityName" id="WorkCityName" onclick="getWorkCity()" class="form-control"
                               type="text" required>
                        <input name="WorkCity" id="WorkCity" class="form-control" type="hidden">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">公司邮箱：</label>
                    <div class="col-sm-8">
                        <input name="EMail" id="EMail" class="form-control" type="text" />
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">办公电话：</label>
                    <div class="col-sm-8">
                        <input name="officePhone" id="officePhone" class="form-control" type="text" />
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">档案号：</label>
                    <div class="col-sm-8">
                        <input name="archiveid" id="archiveid" class="form-control" type="text">
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>入职渠道：</label>
                    <div class="col-sm-8">
                        <select name="JoinType" id="JoinType" class="form-control m-b"
                                th:with="type=${@dict.getType('eCD_JoinType')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>入职日期：</label>
                    <div class="col-sm-8">
                        <input name="JoinDate" id="JoinDate" class="form-control laydate-demo-1" type="text" required />
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">司龄调整：</label>
                    <div class="col-sm-8">
                        <input name="CyearAdjust" id="CyearAdjust" class="form-control" type="text" />
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">参加工作时间：</label>
                    <div class="col-sm-8">
                        <input name="WorkBeginDate" id="WorkBeginDate" class="form-control laydate-demo-1" type="text" />
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">实习开始日期：</label>
                    <div class="col-sm-8">
                        <input name="PracBeginDate" id="PracBeginDate" class="form-control laydate-demo-1" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">实习期限：</label>
                    <div class="col-sm-8">
                        <input name="PracTerm" id="PracTerm" class="form-control" type="text">
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">实习终止日期：</label>
                    <div class="col-sm-8">
                        <input name="PracEndDate" id="PracEndDate" class="form-control laydate-demo-1" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">试用开始日期：</label>
                    <div class="col-sm-8">
                        <input name="ProbBeginDate" id="ProbBeginDate" class="form-control laydate-demo-1" type="text">
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">试用期限：</label>
                    <div class="col-sm-8">
                        <input name="ProbTerm" id="ProbTerm" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">试用终止日期：</label>
                    <div class="col-sm-8">
                        <input name="ProbEndDate" id="ProbEndDate" class="form-control laydate-demo-1" type="text">
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>合同类型：</label>
                    <div class="col-sm-8">
                        <select name="ConType" id="ConType" class="form-control m-b"
                                th:with="type=${@dict.getType('eCD_ConType')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>合同属性：</label>
                    <div class="col-sm-8">
                        <select name="ConProperty" id="ConProperty" class="form-control m-b"
                                th:with="type=${@dict.getType('eCD_ConProperty')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>签约单位：</label>
                    <div class="col-sm-8">
                        <select id="Contract" name="Contract" class="form-control">
                            <option value="">请选择</option>
                            <option th:each="contract:${contract}" th:value="${contract.id}"
                                    th:text="${contract.title}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>合同开始日期：</label>
                    <div class="col-sm-8">
                        <input name="ConBeginDate" id="ConBeginDate" class="form-control laydate-demo-1" type="text"
                               required>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>合同期(年)：</label>
                    <div class="col-sm-8">
                        <input name="ConTerm" id="ConTerm" class="form-control" onkeyup = "value=value.replace(/[^\d]/g,'')" type="text" required>

                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>合同结束日期：</label>
                    <div class="col-sm-8">
                        <input name="ConEndDate" id="ConEndDate" class="form-control laydate-demo-1" type="text"
                               required />
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>国籍/地区：</label>
                    <div class="col-sm-8">
                        <select name="Country" id="Country" class="form-control m-b"
                                th:with="type=${@dict.getType('eCD_Country')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>名族：</label>
                    <div class="col-sm-8">
                        <select name="Nation" id="Nation" class="form-control m-b"
                                th:with="type=${@dict.getType('eCD_Nation')}">
                            <option value="请选择">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select></div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>证件类型：</label>
                    <div class="col-sm-8">
                        <select name="CertType" id="CertType" class="form-control m-b"
                                th:with="type=${@dict.getType('eCD_CertType')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>证件编号：</label>
                    <div class="col-sm-8">
                        <input name="CertNo" id="CertNo" class="form-control" onblur="getGenderAndBirthDay()" type="text" required />
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>性别：</label>
                    <div class="col-sm-8">
                        <input name="GenderName" id="GenderName" class="form-control" type="text" required>
                        <input name="Gender" id="Gender" class="form-control" type="hidden" required>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>出生日期：</label>
                    <div class="col-sm-8">
                        <input name="BirthDay" id="BirthDay" class="form-control laydate-demo-1" type="text" required>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>籍贯：</label>
                    <div class="col-sm-8">
                        <input name="Resident" id="Resident" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">身份证地址：</label>
                    <div class="col-sm-8">
                        <input name="certaddress" id="certaddress" class="form-control" type="text">
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">婚姻状况：</label>
                    <div class="col-sm-8">
                        <select name="Marriage" id="Marriage" class="form-control m-b"
                                th:with="type=${@dict.getType('eCD_Marriage')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select></div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">政治面貌：</label>
                    <div class="col-sm-8">
                        <select name="Party" id="Party" class="form-control m-b"
                                th:with="type=${@dict.getType('eCD_Party')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select></div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">是否参军：</label>
                    <div class="col-sm-8">
                        <select id="army" name="army" class="form-control m-b">
                            <option value="">请选择</option>
                            <option value="0">否</option>
                            <option value="1">是</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">退伍部队：</label>
                    <div class="col-sm-8">
                        <input name="leavearmy" id="leavearmy" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">最高学历：</label>
                    <div class="col-sm-8">
                        <select name="HighLevel" id="HighLevel" class="form-control m-b"
                                th:with="type=${@dict.getType('ECD_EDUTYPE')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select></div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">最高学历毕业院校：</label>
                    <div class="col-sm-8">
                        <input name="highschool" id="highschool" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">最高学历毕业时间：</label>
                    <div class="col-sm-8">
                        <input name="highenddate" id="highenddate" class="form-control laydate-demo-1" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">最高学历专业：</label>
                    <div class="col-sm-8">
                        <input name="Major" id="Major" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">最高职称/资格证书：</label>
                    <div class="col-sm-8">
                        <input name="HighTitle" id="HighTitle" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">现在住址：</label>
                    <div class="col-sm-8">
                        <input name="Address" id="Address" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">联系电话：</label>
                    <div class="col-sm-8">
                        <input name="Tel" id="Tel" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">私人邮箱：</label>
                    <div class="col-sm-8">
                        <input name="eMailPers" id="eMailPers" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">紧急联系人：</label>
                    <div class="col-sm-8">
                        <input name="EmergencyName" id="EmergencyName" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">紧急联系人电话：</label>
                    <div class="col-sm-8">
                        <input name="emergencytel" id="emergencytel" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">星座：</label>
                    <div class="col-sm-8">
                        <input name="Constellation" id="Constellation" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">QQ：</label>
                    <div class="col-sm-8">
                        <input name="QQ" id="QQ" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">微信：</label>
                    <div class="col-sm-8">
                        <input name="Wechart" id="Wechart" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">备注：</label>
                    <div class="col-sm-8">
                        <input name="Remark" id="Remark" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<button onclick="aaa()">
    测试
</button>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">


    var prefix = ctx + "entryManage/newEmpRegister";

    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });
        });
    });

    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-entrymanage-add").serializeArray();

            //下拉框校验
            //公司
            var compId = $("#compId").val();
            //部门
            var depId = $("#depId").val();
            //岗位
            var jobId = $("#jobId").val();
            //员工类别
            var EmpType = $("#EmpType").val();
            //入职渠道
            var JoinType = $("#JoinType").val();
            //合同类型
            var ConType = $("#ConType").val();
            //合同属性
            var ConProperty = $("#ConProperty").val();
            //签约单位
            var Contract = $("#Contract").val();
            //国籍/地区
            var Country = $("#Country").val();
            //名族
            var Nation = $("#Nation").val();
            //证件类型
            var CertType = $("#CertType").val();
            //性别
            var Gender = $("#Gender").val();
            if (compId == "" || compId == null) {
                $.modal.alertWarning("请选择公司!");
                return;
            } else if (depId == "" || depId == null) {
                $.modal.alertWarning("请选择部门!");
                return;
            } else if (jobId == "" || jobId == null) {
                $.modal.alertWarning("请选择岗位!");
                return;
            } else if (EmpType == "" || EmpType == null) {
                $.modal.alertWarning("请选择员工类别!");
                return;
            } else if (JoinType == "" || JoinType == null) {
                $.modal.alertWarning("请选择入职渠道!");
                return;
            } else if (ConType == "" || ConType == null) {
                $.modal.alertWarning("请选择合同类型!");
                return;
            } else if (ConProperty == "" || ConProperty == null) {
                $.modal.alertWarning("请选择合同属性!");
                return;
            } else if (Contract == "" || Contract == null) {
                $.modal.alertWarning("请选择签约单位!");
                return;
            } else if (Country == "" || Country == null) {
                $.modal.alertWarning("请选择国籍/地区!");
                return;
            } else if (Nation == "" || Nation == null) {
                $.modal.alertWarning("请选择名族!");
                return;
            } else if (CertType == "" || CertType == null) {
                $.modal.alertWarning("请选择证件类型!");
                return;
            } else if (Gender == "" || Gender == null) {
                $.modal.alertWarning("请选择性别!");
                return;
            }

            //不是必填的下拉框




            //核心高管
            var hxgg = $("#hxgg").val();

            //婚姻状况
            var Marriage = $("#Marriage").val();

            //政治面貌
            var Party = $("#Party").val();

            //最高学历
            var HighLevel = $("#HighLevel").val();


            //文本框

            //工号
            var badge = $("#badge").val();

            //姓名
            var name = $("#name").val();

            //直接上级
            var ReportTo = $("#ReportTo").val();

            //职能上级
            var WFReportTo = $("#WFReportTo").val();

            //工作城市
            var WorkCity = $("#WorkCity").val();

            //公司邮箱
            var EMail = $("#EMail").val();

            //办公电话
            var officePhone = $("#officePhone").val();

            //档案号
            var archiveid = $("#archiveid").val();

            //入职日期
            var JoinDate = $("#JoinDate").val();

            //司龄调整
            var CyearAdjust = $("#CyearAdjust").val();

            //参加工作时间
            var WorkBeginDate = $("#WorkBeginDate").val();

            //实习开始日期
            var PracBeginDate = $("#PracBeginDate").val();

            //实习期限
            var PracTerm = $("#PracTerm").val();

            //实习终止日期
            var PracEndDate = $("#PracEndDate").val();

            //试用开始日期
            var ProbBeginDate = $("#ProbBeginDate").val();

            //试用期限
            var ProbTerm = $("#ProbTerm").val();

            //试用终止日期
            var ProbEndDate = $("#ProbEndDate").val();

            //合同开始日期
            var ConBeginDate = $("#ConBeginDate").val();

            //合同(年)
            var ConTerm = $("#ConTerm").val();

            //合同结束日期
            var ConEndDate = $("#ConEndDate").val();

            //证件编号
            var CertNo = $("#CertNo").val();

            //出生日期
            var BirthDay = $("#BirthDay").val();

            //籍贯
            var Resident = $("#Resident").val();

            //身份证地址
            var certaddress = $("#certaddress").val();

            //是否参军
            var army = $("#army").val();

            //退伍部队
            var leavearmy = $("#leavearmy").val();

            //最高学历毕业院校
            var highschool = $("#highschool").val();

            //最高学历毕业时间
            var highenddate = $("#highenddate").val();

            //最高学历专业
            var Major = $("#Major").val();

            //最高职称/资格证书
            var HighTitle = $("#HighTitle").val();

            //现在住址
            var Address = $("#Address").val();

            //联系电话
            var Tel = $("#Tel").val();

            //私人邮箱
            var eMailPers = $("#eMailPers").val();

            //紧急联系人
            var EmergencyName = $("#EmergencyName").val();

            //紧急联系人电话
            var emergencytel = $("#emergencytel").val();

            //星座
            var Constellation = $("#Constellation").val();

            //QQ
            var QQ = $("#QQ").val();

            //微信
            var Wechart = $("#Wechart").val();

            //备注
            var Remark = $("#Remark").val();



            data.push({"name": "compId", "value": compId});
            data.push({"name": "depId", "value": depId});
            data.push({"name": "jobId", "value": jobId});
            data.push({"name": "EmpType", "value": EmpType});
            data.push({"name": "JoinType", "value": JoinType});
            data.push({"name": "ConType", "value": ConType});
            data.push({"name": "ConProperty", "value": ConProperty});
            data.push({"name": "Contract", "value": Contract});
            data.push({"name": "Country", "value": Country});
            data.push({"name": "Nation", "value": Nation});
            data.push({"name": "CertType", "value": CertType});
            data.push({"name": "Gender", "value": Gender});
            data.push({"name": "hxgg", "value": hxgg});
            data.push({"name": "Marriage", "value": Marriage});
            data.push({"name": "Party", "value": Party});
            data.push({"name": "HighLevel", "value": HighLevel});
            data.push({"name": "badge", "value": badge});
            data.push({"name": "name", "value": name});
            data.push({"name": "ReportTo", "value": ReportTo});
            data.push({"name": "WFReportTo", "value": WFReportTo});
            data.push({"name": "WorkCity", "value": WorkCity});
            data.push({"name": "EMail", "value": EMail});
            data.push({"name": "officePhone", "value": officePhone});
            data.push({"name": "archiveid", "value": archiveid});
            data.push({"name": "JoinDate", "value": JoinDate});
            data.push({"name": "CyearAdjust", "value": CyearAdjust});
            data.push({"name": "WorkBeginDate", "value": WorkBeginDate});
            data.push({"name": "PracBeginDate", "value": PracBeginDate});
            data.push({"name": "PracTerm", "value": PracTerm});
            data.push({"name": "PracEndDate", "value": PracEndDate});
            data.push({"name": "ProbBeginDate", "value": ProbBeginDate});
            data.push({"name": "ProbTerm", "value": ProbTerm});
            data.push({"name": "ProbEndDate", "value": ProbEndDate});
            data.push({"name": "ConBeginDate", "value": ConBeginDate});
            data.push({"name": "ConTerm", "value": ConTerm});
            data.push({"name": "ConEndDate", "value": ConEndDate});
            data.push({"name": "CertNo", "value": CertNo});
            data.push({"name": "BirthDay", "value": BirthDay});
            data.push({"name": "Resident", "value": Resident});
            data.push({"name": "certaddress", "value": certaddress});
            data.push({"name": "army", "value": army});
            data.push({"name": "leavearmy", "value": leavearmy});
            data.push({"name": "highschool", "value": highschool});
            data.push({"name": "highenddate", "value": highenddate});
            data.push({"name": "Major", "value": Major});
            data.push({"name": "HighTitle", "value": HighTitle});
            data.push({"name": "Address", "value": Address});
            data.push({"name": "Tel", "value": Tel});
            data.push({"name": "eMailPers", "value": eMailPers});
            data.push({"name": "EmergencyName", "value": EmergencyName});
            data.push({"name": "emergencytel", "value": emergencytel});
            data.push({"name": "Constellation", "value": Constellation});
            data.push({"name": "QQ", "value": QQ});
            data.push({"name": "Wechart", "value": Wechart});
            data.push({"name": "Remark", "value": Remark});
            $.operate.save(prefix + "/add", data);
        }
    }

    function getbumen(value) {
        var html = "";
        $.ajax({
            async: false,
            url: ctx + "empentry/findDep",
            data: {
                "compID": value
            },
            type: "post",
            dataType: "json",
            success: function (data) {
                $("#depId").empty();
                var arry = data;
                html += "<option value=''>请选择</option>";
                for (var i = 0; i < arry.length; i++) {
                    html += "<option value='"
                        + arry[i].depID
                        + "'>"
                        + arry[i].title
                        + "</option>";
                }
                $("#depId").append(html);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert("错误,请联系管理员,错误信息:" + textStatus);
            }
        });
    }

    function getgangwei(value) {
        var html = "";
        $.ajax({
            async: false,
            url: ctx + "empentry/findJob",
            data: {
                "DepID": value
            },
            type: "post",
            dataType: "json",
            success: function (data) {
                $("#jobId").empty();
                var arry = data;
                html += "<option value=''>请选择</option>";
                for (var i = 0; i < arry.length; i++) {
                    html += "<option value='"
                        + arry[i].jobID
                        + "'>"
                        + arry[i].title
                        + "</option>";
                }
                $("#jobId").append(html);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {

                alert("错误,请联系管理员,错误信息:" + textStatus);
            }
        });
    }

    function getReportTo() {
        $.modal.open("选择直接上级", prefix + "/getReportTo?type=ReportTo");
    }

    function getWFReportTo() {
        $.modal.open("选择职能上级", prefix + "/getReportTo?type=WFReportTo");
    }

    function getWorkCity() {
        $.modal.open("选择工作城市", prefix + "/getWorkCity");
    }

    function getJobGrade(){
        $.ajax({
            async: false,
            url: ctx + "entryManage/newEmpRegister/getJobGrade",
            data: {
                "jobId": $("#jobId").val()
            },
            type: "post",
            dataType: "text",
            success: function (data) {
                $("#JobGrade").val(data);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert("错误,请联系管理员,错误信息:" + textStatus);
            }
        });
    }

    function getGenderAndBirthDay(){
        $.ajax({
            async: false,
            url: ctx + "entryManage/newEmpRegister/getGenderAndBirthDay",
            data: {
                "CertType": $("#CertType").val(),
                "CertNo": $("#CertNo").val()
            },
            type: "post",
            dataType: "json",
            success: function (data) {
                if(data.gender == 1){
                    $("#GenderName").val("男");
                    $("#Gender").val("1");
                }else if(data.gender == 2){
                    $("#Gender").val("2");
                }
                $("#BirthDay").val(data.BirthDay);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert("错误,请联系管理员,错误信息:" + textStatus);
            }
        });
    }

</script>
</body>
</html>
